# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=ssh-key-confirmer
pkgver=0.1
pkgrel=2
pkgdesc='Test ssh login key acceptance without having the private key'
url='https://github.com/benjojo/ssh-key-confirmer'
arch=('loong64' 'x86_64')
license=('MIT')
makedepends=('go')
source=(https://github.com/benjojo/${pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
b2sums=('40d339e77a476f137eafc8b3b41880c05646cb58ef184d8ecde1f194148e23827ebec94555cc371769573823829f8a9333df7f79edcb3c7d91b4bc28a4068aee')

build() {
  cd ${pkgname}-${pkgver}
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=readonly -modcacherw"
  go build -o ssh-key-confirmer .
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm755 ssh-key-confirmer -t "${pkgdir}/usr/bin"
  install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
